<template>
  <div>
    <basic-container>
      <!-- <el-header> -->
      <div class="flex_between" style="align-items: flex-start;">
        <el-button size="small" type="success" @click="creatNew()" v-if="permission.zlsc_creat && none">创建</el-button>
        <div v-else></div>
        <el-form :inline="true" style="text-align: right;" size="small" class="ml10" ref="form" :model="form" @keyup.enter.native="refreshList()">
          <el-form-item label="文件名称："><el-input placeholder="请输入" v-model="form.name"></el-input></el-form-item>
          <el-form-item label="文件编号："><el-input placeholder="请输入" style="width: 100px;" v-model="form.fileNumber"></el-input></el-form-item>
          <el-form-item label="文件版本号："><el-input placeholder="请输入" style="width: 100px;" v-model="form.versionNumber"></el-input></el-form-item>
          <el-form-item label="控制状态：">
            <el-select>
              <el-select v-model="form.controlStatus">
                <el-option label="受控" value="0"></el-option>
                <el-option label="非受控" value="1"></el-option>
              </el-select>
            </el-select>
          </el-form-item>
          <el-form-item label="内部/外来文件：">
            <el-select v-model="form.fileSource">
              <el-option label="内部文件" value="0"></el-option>
              <el-option label="外来文件" value="1"></el-option>
            </el-select>
          </el-form-item>

          <el-form-item><el-button type="primary" @click="refreshList(1)">查询</el-button></el-form-item>
          <el-form-item><el-button type="default" plain @click="resetSearch">重置</el-button></el-form-item>
          <el-form-item>
            <el-button type="primary" plain @click="showmore = !showmore">
              更多筛选条件
              <i :class="{ 'el-icon-arrow-down': !showmore, 'el-icon-arrow-up': showmore }"></i>
            </el-button>
          </el-form-item>
          <block style="margin-top: 0px;" v-if="showmore">
            <el-form-item label="编制部门">
              <el-cascader
                placeholder="请选择"
                ref="newdept"
                :options="deptOption"
                v-model="form.createDept"
                :show-all-levels="false"
                :props="{
                  value: 'id',
                  label: 'deptName',
                  emitPath: false
                }"
                filterable
                @change="getMemberOption"
              ></el-cascader>
            </el-form-item>
            <el-form-item label="编制人">
              <el-select placeholder="请选择" v-model="form.createUser" filterable>
                <el-option v-for="(item, i) in memberOption" :key="i" :value="item.id" :label="item.name"></el-option>
              </el-select>
            </el-form-item>
            <el-form-item label="提交日期：">
              <el-date-picker
                v-model="form.createTime"
                type="daterange"
                start-placeholder="开始日期"
                value-format="yyyy-MM-dd"
                end-placeholder="结束日期"
                :default-time="['00:00:00', '23:59:59']"
                style="width: 300px;"
              ></el-date-picker>
            </el-form-item>
            <el-form-item label="文件生效日期：">
              <el-date-picker
                v-model="form.beginTime"
                type="daterange"
                start-placeholder="开始日期"
                value-format="yyyy-MM-dd"
                end-placeholder="结束日期"
                :default-time="['00:00:00', '23:59:59']"
                style="width: 300px;"
              ></el-date-picker>
            </el-form-item>
          </block>
        </el-form>
      </div>
      <!-- </el-header> -->
    </basic-container>
    <basic-container>
      <el-table :data="tableData" :height="$height - 300 + 'px'" v-loading="loading">
        <el-table-column type="index" width="50" label="序号"></el-table-column>
        <el-table-column prop="title" label="求购消息标题"></el-table-column>
        <el-table-column prop="company" label="联系公司"></el-table-column>
        <el-table-column prop="name" label="联系人"></el-table-column>
        <el-table-column prop="phone" label="联系电话"></el-table-column>
        <el-table-column prop="createTime" label="发布时间"></el-table-column>
        <el-table-column label="操作">
          <template slot-scope="scope">
            <span class="pointer main_co f14" v-if="permission.zlsc_show" @click="handleShow(scope.row)">查看</span>
            <span class="pointer success_f f14 ml30" v-if="permission.zlsc_update" @click="handleUpdate(scope.row)">修改</span>
            <span class="pointer red_f f14 ml30" v-if="permission.zlsc_cancel">删除</span>
          </template>
        </el-table-column>
        <empty slot="empty"></empty>
      </el-table>
      <el-card class="pub_right">
        <el-pagination
          @size-change="sizeChangeHandle"
          @current-change="currentChangeHandle"
          :current-page="pageNo"
          :page-size="pageSize"
          :total="total"
          background
          layout="total, prev, pager, next, jumper"
        ></el-pagination>
      </el-card>
    </basic-container>
  </div>
</template>

<script>
export default {
  data() {
    return {
      form: {},
      tableData: []
    };
  },
  methods: {}
};
</script>

<style></style>
